﻿<!DOCTYPE html>
<html>
<head>
    <title>JS Strings Exercise 5</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <h1>Function that replaces non breaking white-spaces in a text with &amp;nbsp;.</h1>
    <button onclick="execute()">execute</button>
    <div id="js-console"></div>
    <script src="scripts/js-console.js"></script>
    <script>
        function replaceNonBrakeSpace(str)
        {
            return str.replace('\u00A0', '&nbsp;');;
        }

        function execute()
        {
            var inpStr = "100\u00A0km per hour";
            var resStr = replaceNonBrakeSpace(inpStr);

            jsConsole.writeLine("Result: " + resStr);
        }
    </script>
</body>
</html>
